# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-cluster
pkgname=('python2-cluster' 'python-cluster')
pkgver=1.4.1.post3
pkgrel=5
pkgdesc='Allows grouping a list of arbitrary objects into related groups (clusters).'
arch=('any')
url='https://github.com/exhuma/python-cluster'
license=('LGPL')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://github.com/exhuma/python-cluster/archive/v$pkgver.tar.gz")
sha512sums=('1be21befdc8073ca4ce037342326868da5bcd1a9ab87345c22572e31d20c3e420989de706e47ff8ca1588b7390b840129db17deee86109acfcff636204a58867')

prepare() {
  cp -a "$pkgbase-$pkgver"{,-2}
}

build() {
  cd "$pkgbase-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$pkgbase-$pkgver"

  python setup.py build
}

package_python2-cluster() {
  depends=('python2')

  cd "$pkgbase-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-cluster() {
  depends=('python')

  cd "$pkgbase-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

